<?php


namespace app\api\model;

use app\api\controller\Code;
use think\Db;
use think\Model;

/**
 * orc信息
 * Class OcrInfoModel
 * @package app\api\model
 *
 */
class OcrInfoModel extends Model
{

    /**
     * 设置表名
     * @var string
     */
    protected $table = 'ah_ocrinfo';

    /**
     *
     * ocr病例信息添加
     */
    public static function ocrInfoAdd($params){

        $ocr['meeting_id'] = $params['meeting_id'];
        $ocr['ocr_info'] = json_encode($params['ocr_info'],true);

        return self::insert($ocr);
    }

    /**
     *
     * ocr病例信息添加
     */
    public static function ocrInfoList($meeting_id){

        return self::where(['meeting_id'=>$meeting_id])
            ->field('id,meeting_id,ocr_info')
            ->order('id desc')
            ->select()->each(function($item){

                $item['ocr_info'] = json_decode($item['ocr_info'],true);
            });
    }




}